package com.meishij;

import android.content.Intent;
import android.os.Parcelable;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.meishij.adapter.MallSellImagesViewPagerAdapter;
import com.meishij.entry.MallEntry;
import com.meishij.entry.MallSellEntry;

import java.util.List;

public class MallSellImageActivity extends AppCompatActivity {

    private MallSellImagesViewPagerAdapter mallSellImagesViewPagerAdapter;
    private ViewPager viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mall_sell_image);
        viewPager = (ViewPager) findViewById(R.id.mall_sell_images_viewpager);
        Intent intent = getIntent();
        int position = intent.getIntExtra("position", 0);
        List<MallSellEntry.ObjBean.ImagesBean> images = (List<MallSellEntry.ObjBean.ImagesBean>) intent.getSerializableExtra("images");
        mallSellImagesViewPagerAdapter = new MallSellImagesViewPagerAdapter(images,this);
        viewPager.setAdapter(mallSellImagesViewPagerAdapter);
        viewPager.setCurrentItem(position,false);
    }
}
